import ky from 'ky'
import { Me } from './me'

export type UsernamePasswordLoginPayload = {
    username: string,
    password: string
}


export const usernamePasswordLogin = async (payload: UsernamePasswordLoginPayload): Promise<Me> =>
    ky.post("/apis/auth/login/up", { json: payload }).json()